<?php
// 文章内容页控制器
class Controller_WWW_Article extends Controller_WWW_Template
{
    public function __construct ($req, $res)
    {
        $this->template = "smarty:www/article/detail";
        parent::__construct($req, $res);
    }

    public function action_key ($key)
    {
        $article = new Article;
        $detail  = $article->articleByKey($key);
        $this->template->set('article', $detail);
    }

    public function action_index ($articleId)
    {
        $article = new Article;
        $detail  = $article->articleById($articleId);
        $this->template->set('article', $detail);
    }

    public function action_list ($type)
    {
        $article  = new Article;
        $articles = $article->listByType($type);

        $this->template->set_filename('smarty:www/article/list');
        $this->template->set('articles', $articles);
    }

    public function action_detail($id){
        $article  = new Article;
        $articles = $article->articleById($id);
        $this->template->set('article',$articles);
        $this->template->set_filename('smarty:www/service/dongtai/detail');
    }


}
